﻿using System;

namespace TestByWire
{
    public class Scenario
    {
        [ThreadStatic]
        private static Boolean _recordingScenario;

        public static void Is(Action setUp)
        {
            if (setUp == null)
                throw new ArgumentNullException("setUp", "Scenario is null");

            _recordingScenario = true;
            try
            {
                setUp.Invoke();
            }
            finally
            {
                _recordingScenario = false;
            }

        }

        internal static Boolean IsRecording()
        {
            return _recordingScenario;
        }
    }
}
